<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <my-cpnc></my-cpnc>
        <my-cpnc></my-cpnc>
        <cpn></cpn>
    </div>
</body>
<script src='../js/vue.js'></script>
<script>
    // 1.全局组件
    const cpnc = Vue.extend({
        template:`
            <div>
                <h2>我是全局组件</h2>    
            </div>
        `
    })
    Vue.component('my-cpnc', cpnc)

    let app = new Vue({
        el: '#app',
        data: {
             msg:'hello vue.js'
        },
        methods: {},
        components: {
            // 局部组件
            cpn:cpnc
        }
    })
</script>
</html>